package com.watson.s2sh.platform.action;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.watson.s2sh.platform.domain.MenuItem;
import com.watson.s2sh.platform.service.MenuItemService;

public class MenuItemAction extends ActionSupport {
	private static final long serialVersionUID = 1L;

	private MenuItem menuItem;
	private List<MenuItem> menuItemList;
	
	private MenuItemService menuItemService;
	
	public String openMenuItemList() throws Exception {
		System.out.println("open MenuItem List Page!");
		menuItemList = menuItemService.findAllMenuItem();
		return SUCCESS;
	}
	
	public String openMenuItemForm() throws Exception {
		System.out.println("open MenuItem page!");
		return SUCCESS;
	}
	
	public String saveMenuItem() throws Exception {
		menuItemService.save(menuItem);
		System.out.println("open save successful!");
		return SUCCESS;
	}


	public MenuItemService getMenuItemService() {
		return menuItemService;
	}

	public void setMenuItemService(MenuItemService menuItemService) {
		this.menuItemService = menuItemService;
	}

	public List<MenuItem> getMenuItemList() {
		return menuItemList;
	}

	public void setMenuItemList(List<MenuItem> menuItemList) {
		this.menuItemList = menuItemList;
	}

	public MenuItem getMenuItem() {
		return menuItem;
	}

	public void setMenuItem(MenuItem menuItem) {
		this.menuItem = menuItem;
	}

}